﻿Imports Publics
'Đối tượng lưu trữ thông tin người sử dụng
Public Class clsNguoiDung
    Private _CanBo As DM_NhanVien
    Public Property CanBo() As DM_NhanVien
        Get
            Return _CanBo
        End Get
        Set(ByVal value As DM_NhanVien)
            _CanBo = value
        End Set
    End Property

    Private _Nhom As Collections.ArrayList
    Property Nhom() As Collections.ArrayList
        Get
            Return _Nhom
        End Get
        Set(ByVal value As Collections.ArrayList)
            _Nhom = value
        End Set
    End Property

    Private _Quyen As List(Of String)
    Property Quyen() As List(Of String)
        Get
            Return _Quyen
        End Get
        Set(ByVal value As List(Of String))
            _Quyen = value
        End Set
    End Property

    Private _DonVi As DM_DonVi
    Public Property DonVi() As DM_DonVi
        Get
            Return _DonVi
        End Get
        Set(ByVal value As DM_DonVi)
            _DonVi = value
        End Set
    End Property


    Public Function KiemTraQuyen(Optional ByVal QuyenCode As String = "") As Boolean
        'Kiểm tra user có quyền không, kết quả: true| false
        Return _Quyen.Contains(QuyenCode)
    End Function

    Public Function KiemTraNhom(Optional ByVal ID_Nhom As Integer = 0) As Boolean
        'Kiểm tra user có thuộc nhóm không, kết quả: true| false
        Return _Nhom.Contains(ID_Nhom)

    End Function
End Class